package com.artPreter.config;

import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class FilterConfig {

    @Bean
    public FilterRegistrationBean<RedirectFilter> redirectFilter() {
        FilterRegistrationBean<RedirectFilter> registrationBean = new FilterRegistrationBean<>();
        registrationBean.setFilter(new RedirectFilter());
        registrationBean.addUrlPatterns("/*"); // 过滤所有请求
        registrationBean.setOrder(1); // 设置过滤器顺序
        return registrationBean;
    }
}
